package com.arpa.wms.domain.enums;

import java.util.HashMap;
import java.util.Map;

/**
 * @author: Allen chen
 * @Date 2020/10/12
 * @Description:
 */
public enum DeleteFlagEnum {
    /**
     * 删除标志
     */
    NOTDELETE(0, "不可删除"),
    CANDELETE(1, "可以删除");

    private final Integer code;
    private final String msg;

    DeleteFlagEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    private static final Map<Integer,DeleteFlagEnum> ENUM_MAP = new HashMap();

    static {
        DeleteFlagEnum[] values = values();
        int length = values.length;
        for(int i = 0; i < length; i++){
            DeleteFlagEnum value1 = values[i];
            ENUM_MAP.put(value1.getCode(),value1);
        }
    }

    public static DeleteFlagEnum getEnumByValue(String value){

        return ENUM_MAP.get(value);
    }

    public Integer getCode() {
        return code;
    }


    public String getMsg() {
        return msg;
    }

}
